    
    public function {$actionName}($id)
    {
        // chequeo y obtengo el usuario loggeado
        $data['logueado'] = $this->getUsuarioLogueado();

        // valido permisos
        $gruposValidos = array();
        // ej. array('venta','logistica','contable','directivo');
        $this->validarPermisos($data['logueado'], $gruposValidos);

        // get object to delete
        $data['{$entity->singular}'] = new {$entity->singular|capitalize:true}($id);
        
        if ($data['{$entity->singular}']->delete()) {

            // delete related actions based on purpose
            $this->afterDeleteSuccess($data);

            // Show success message in next view
            $data['msg']          = new PwMsgHandler();
            $data['msg']->success = '{$entity->singular} successfully deleted';
            $data['msg']->persistSuccess();

            // redirects to create a new object
            redirect(base_url() . '{$entity->plural}/{$createMethod}/');
        }
    } // function {$actionName}